// em
//
// Generates an `em` value from a pixel measurement, derived from the base type
// size.
//
// $pixels  - The desired pixel value.
// $context - The font size to derive the `em` value from. Defaults to `$global-type-size`.
//
// Styleguide Logic.Functions.em
@use "sass:math";

@function em($pixels, $context: $global-type-size) {
	@if (unitless($pixels)) {
		$pixels: $pixels * 1px;
	}
	@if (unitless($context)) {
		$context: $context * 1px;
	}
	@return math.div($pixels, $context) * 1em;
}
